package com.myk.game.lib.utils;

import android.view.View;

public class ViewUtil {
    /**
     * 判断指定坐标是否在指定View的屏幕坐标范围内
     */
    public static boolean inRangeOfView(View view, int ex,int ey){
        int[] location = new int[2];
        view.getLocationOnScreen(location);
        int x = location[0];
        int y = location[1];
        int xx = x + view.getWidth();
        int yy = y + view.getHeight();
        return !(ex < x) && !(ex > xx) && !(ey < y) && !(ey > yy);
    }
}
